<template name="enterprise">
	<view>

		
		<view :class="'bg-'+$bgColor()">
				
				<view class="padding flex bg-white">
					<uni-search-bar radius="100" class="flex-treble radius " placeholder="工程" @confirm="search" />
				</view>
				<view class="cu-list menu-avatar">
					<view class="cu-item" style="height: 260px;" :class="modalName=='move-box-'+ index?'move-cur':''" v-for="(item,index) in data" :key="index"
					 :data-target="'move-box-' + index">
						<view class="content">
							<view class="cu-form-group ">
								<view class="title" >片区:</view>
								<input  name="zone" :value="item.zone" disabled="disabled"></input>
							</view>
							<view class="cu-form-group ">
								<view class="title" >工程:</view>
								<input  name="project" :value="item.project" disabled="disabled"></input>
							</view>
							<view class="cu-form-group ">
								<view class="title" >抽取名单:</view>
								<input  name="nameList" :value="item.nameList" disabled="disabled"></input>
							</view>
							<view class="cu-form-group ">
								<view class="title" >抽取人:</view>
								<input  name="chooseBy" :value="item.chooseBy" disabled="disabled"></input>
							</view>
							<view class="cu-form-group ">
								<view class="title" >抽取时间:</view>
								<input  name="chooseTime" :value="item.chooseTime" disabled="disabled"></input>
							</view>
					
						</view>
					</view>
				</view>
			</view>
			<view class="margin-top">
				<uni-pagination :show-icon="true" :total="total" title="标题文字" @change="changePage" />
			</view>
			<view class="cu-tabbar-height"></view>
		</view>
		
</template>

<script>
	import uniSearchBar from '@/components/uni-search-bar/uni-search-bar.vue'
	import uniSection from '@/components/uni-section/uni-section.vue'
	import uniPagination from '@/components/uni-pagination/uni-pagination.vue'
	
	export default {
		data() {
			return {
				data:[],
				searchVal:'',
				district:'',
				index: -1,
				picker: [],
				pageNum: 1,
				pageSize: 10,
				modalName:'',
				total: 50
			}
		},
		mounted() {
			// 初始化加载
			this.req();
		},
		methods: {
			req(){
				var param = {
					"project":this.searchVal,
					"pageSize":this.pageSize,
					"pageNum":this.pageNum
				}
				
				this.$httpPost("/system/record/list",param).then( res=>{
					this.data = (res.data.rows);
					if(!this.data ||this.data.length == 0){
						this.data =[{
							zone:""
						}]
					}
					this.total = res.data.total;
				})
				
			},
			search(res) {
				this.searchVal=res.value
				this.req();
			},
			changePage(e) {
				this.pageNum = e.current
				this.req();
			}
		}
	}
</script>

<style>
	.cu-list.menu-avatar>.cu-item .content{
		border: 1px solid #cccccc;
		left: 5px;
		width:97%;
	}
	.cu-form-group .title {
		min-width: calc(4em + 1px);
		text-align: right;
	}
</style>
